﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewPOReceiptProcess.aspx.cs" Inherits="POReceiptProcess.NewPOReceiptProcess" %>

<%@ Register src="../../Processes/ProcessControl/ButtonList.ascx" tagname="buttonlist" tagprefix="btn" %>
<%@ Register src="../../Processes/ProcessControl/ApprovalHistory.ascx" tagname="approvalhistory" tagprefix="ah" %>
<%@ Register src="../../Processes/ProcessControl/Attachments.ascx" tagname="attachments" tagprefix="attach" %>
<%@ Register src="../../Processes/ProcessControl/UserInfo.ascx" tagname="userinfo" tagprefix="ui" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Goods Receive 货物验收单 </title>
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        //选择弹出页面
        function selectPage1() {
            rtn = selectPage("select FORMID,DOCUMENTNO,SUPPLIERNUMBER,SUPPLIERNAME,SUPPLIERPHONE,CONTACT,BUYER,PAYMENT,SUPPLIEREMAIL,CATEGORY,SUBCATEGORIES,TOTALAMOUNT from dbo.PROC_PO where STATUS=2", "DOCUMENTNO", "DOCUMENTNO,SUPPLIERNUMBER,SUPPLIERNAME,SUPPLIERPHONE,CONTACT,BUYER,PAYMENT,SUPPLIEREMAIL", "PO单号,供应商编号,供应商名称,供应商电话,联系人,采购员,支付方式,供应商电子邮件", "20,20,20,30,20,20,20", "选择资源");
            if (rtn) {
                $("#fld_ORDERNUM").val(rtn.DOCUMENTNO);
                $("#fld_SUPPLIERNO").val(rtn.SUPPLIERNUMBER);
                $("#fld_SUPPLIERNAME").val(rtn.SUPPLIERNAME);
                $("#fld_SUPPLIERPHONE").val(rtn.SUPPLIERPHONE);
                $("#txtFormid").val(rtn.FORMID);
                $("#txtCATEGORY").val(rtn.CATEGORY);
                $("#txtSUBCATEGORIES").val(rtn.SUBCATEGORIES);
                $("#fld_AMOUNT").val(rtn.TOTALAMOUNT);
                __doPostBack('LinkButton1', '');
            }
            return false;
        }

        //禁用页面控件编辑事件
        jQuery(document).ready(function () {

            $("#fld_ORDERNUM").keydown(function (event) {

                return false;
            });
            $("#fld_SUPPLIERNO").keydown(function (event) {

                return false;
            });
            $("#fld_SUPPLIERNAME").keydown(function (event) {

                return false;
            });
            $("#fld_SUPPLIERPHONE").keydown(function (event) {

                return false;
            });
        })

        //验证是否已经选择po单号
        function check_po() {

            if ($("#fld_ORDERNUM").val() == "") {
                alert("请选择采购订单号！");
                return false;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
     <div class="container">
            <div class="row">
                <ui:userinfo id="UserInfo1" processtitle="Goods  Receive<br/>货物验收单" processprefix="GR-" tablename="PROC_PORECEIPT"
                    tablenamedetail="PROC_PORECEIPT_DT" runat="server"></ui:userinfo>
            </div>
            <div class="row">
                <table class="table table-condensed table-bordered">
                    <tr>
                        <td class="banner" colspan="6">
                            Application Details / 详细信息
                        </td>
                    </tr>
                    <tr>
                        <td class="td-label">
                            Purchase Order Number/<br />
                            采购订单号
                        </td>
                        <td class="td-content">
                            <asp:TextBox ID="fld_ORDERNUM" runat="server">
                            </asp:TextBox>
                            <asp:Button ID="Button2" runat="server" Text="" Width="10%" Height="25px" CssClass="btn"
                                OnClientClick="return selectPage1();" />
                            <div style="display: none;">
                                <asp:TextBox ID="fld_AMOUNT" Text="" runat="server"></asp:TextBox>
                                <asp:TextBox ID="fld_VIRTUAL" Text="" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtCATEGORY" Text="" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtSUBCATEGORIES" Text="" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtFormid" Text="" runat="server"></asp:TextBox>
                                <asp:LinkButton runat="server" ID="LinkButton1" Text="LinkButton1" OnClick="LinkButton1_Click"></asp:LinkButton>
                            </div>
                        </td>
                        <td class="td-label">
                            Supplier Number/供应商编号
                        </td>
                             <td class="td-content"> 
                            <asp:TextBox ID="fld_SUPPLIERNO" runat="server" CssClass="validate[required]"></asp:TextBox>
                        </td>  
                    </tr> 
                    <tr>
                      <td class="td-label">
                           Supplier Name/供应商名称</td>
                             <td class="td-content"> 
                            <asp:TextBox ID="fld_SUPPLIERNAME" runat="server" CssClass="validate[required]"></asp:TextBox>
                        </td> 
                        <td class="td-label">
                            Supplier Phone/供应商电话                            
                        </td>
                        <td class="td-content">
                            <asp:TextBox ID="fld_SUPPLIERPHONE" runat="server">
                            </asp:TextBox> 
                        </td>
                                          
                    </tr>      
                      <tr>
                        <td class="td-label">
                            Arrival Date/到货日期                            
                        </td>
                        <td class="td-content">
                            <asp:TextBox ID="fld_ARRIVALDATE" onclick="WdatePicker()" runat="server">
                            </asp:TextBox> 
                        </td>
                          <td class="td-label">
                            Needs of People/需求人
                        </td>
                        <td class="td-content">
                            <asp:TextBox ID="fld_DEMANDFORPERSON" runat="server">
                            </asp:TextBox> 
                        </td>                     
                    </tr>                       
                </table>
            </div>
                     <div>
                    <tr>
                        <td colspan="6">
                            <table class="table table-condensed table-bordered tablerequired" id="tbDetail">
                                <tr>
                                    <th style="display:none">
                                        No<br/>序号
                                    </th>                                    
                                    <th>
                                        Material No.<br/>货物名称
                                    </th>
                                    <th>
                                        Material Type<br />物料类型
                                    </th>
                                    <th>
                                        Brand & Model<br />规格型号
                                    </th>
                                    <th>
                                        Unit<br/>单位
                                    </th>
                                    <th>
                                        Compliant Quantity<br/>要求数量
                                    </th>                                   
                                    <th>
                                        Service number<br/>送达数量
                                    </th>
                                    <th>
                                        Returns Quantity<br/>退货数量
                                    </th>                                    
                                      <th>
                                        Remark<br/>备注
                                   </th>
                                    
                                    <th>
                                        <asp:Button ID="btnAdd" runat="server" Text="Add/增加" CssClass="btn" CausesValidation="false"
                                             OnClick="btnAdd_Click" OnClientClick="return check_po()" />
                                    </th>
                                </tr>
                                <asp:Repeater ID="fld_detail_PROC_PORECEIPT_DT" runat="server"  OnItemCommand="fld_detail_PROC_PORECEIPT_DT_ItemCommand">
                                    <ItemTemplate>
                                        <tr>
                                            <td style="display: none">
                                                <asp:TextBox ID="fld_FORMID" Text='<%#Eval("FORMID") %>'  runat="server" Width="80%"></asp:TextBox>
                                                <asp:TextBox ID="fld_IDNO" Text='<%#Eval("IDNO") %>' runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="DDL_ITEMNAME" runat="server" Width="110%"  AutoPostBack="true" OnSelectedIndexChanged="ITEMNAME_OnSelectedIndexChanged" CssClass="validate[required]">
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                              
                                                <asp:DropDownList ID="DDL_ITEMTYPE" runat="server" Width="110%"  AutoPostBack="true" OnSelectedIndexChanged="ITEMTYPE_OnSelectedIndexChanged" CssClass="validate[required]">
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="fld_BRANDMODEL" Text='<%#Eval("BRANDMODEL") %>' runat="server" Width="85%"
                                                    CssClass="validate[required]"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="fld_UNIT"  Text='<%#Eval("UNIT") %>'  runat="server"  Width="85%" CssClass="validate[required]"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="fld_COMPLICANTQUANTITY" money="int" Text='<%#Eval("COMPLICANTQUANTITY") %>' runat="server" Width="85%" CssClass="validate[required,custom[number]]"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="fld_SERVICENUMBER" money="int"  Text='<%#Eval("SERVICENUMBER") %>'  runat="server" Width="85%"
                                                    CssClass="validate[required,custom[number]]"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="fld_RETURNSQUANTITY" money="int"  Text='<%#Eval("RETURNSQUANTITY") %>'  runat="server" Width="85%" CssClass="validate[required]"></asp:TextBox>
                                            </td>                                            
                                             <td >
                                                <asp:TextBox ID="fld_REMARK" Text='<%#Eval("REMARK") %>' runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Button ID="btnDelete" runat="server" Text="Delete/删除" CssClass="btn" CommandName="del"
                                                    ClientIDMode="Static" OnClientClick="return confirm('确认删除？')" />
                                            </td>
                                            <td style=" display:none;">
                                              <asp:TextBox ID="fld_ITEMNAME" Text='<%#Eval("ITEMNAME") %>' runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                            <td style=" display:none;">
                                              <asp:TextBox ID="fld_ITEMTYPE" Text='<%#Eval("ITEMTYPE") %>'  runat="server" Width="80%"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </td>
                    </tr>
                    </div>
            <div class="row">
                <attach:attachments id="Attachments1" runat="server"></attach:attachments>
            </div>
            <div class="row">
                <ah:approvalhistory id="ApprovalHistory1" showaction="false" runat="server"></ah:approvalhistory>
            </div>
            <div class="row">
            <btn:buttonlist id="ButtonList1" runat="server"></btn:buttonlist>
        </div>
        </div>
    </form>
</body>
</html>
